************
* DO-FILE WITH CODE USED TO GENERATE FIGURES AND TABLES IN SECTION III OF:
* Babic, Milan and Lukas Linsi. 2024. "Mapping Corporate Investments Between China and Europe in an Era of Geoeconomic Competition". JCMS: Journal of Common Market Studies
* August 2023
************ 

use orbisdata
/*data used under licence; please contact the authors directly if you have questions about the dataset*/

************
* EUROPEAN COMPANIES
************

tabulate Companycountry

generate eucomp=0
replace eucomp=1 if Companycountry=="AT"
replace eucomp=1 if Companycountry=="BE"
replace eucomp=1 if Companycountry=="CH"
replace eucomp=1 if Companycountry=="CY"
replace eucomp=1 if Companycountry=="CZ"
replace eucomp=1 if Companycountry=="DE"
replace eucomp=1 if Companycountry=="DK"
replace eucomp=1 if Companycountry=="ES"
replace eucomp=1 if Companycountry=="FI"
replace eucomp=1 if Companycountry=="FR"
replace eucomp=1 if Companycountry=="GB"
replace eucomp=1 if Companycountry=="HU"
replace eucomp=1 if Companycountry=="IE"
replace eucomp=1 if Companycountry=="IT"
replace eucomp=1 if Companycountry=="LI"
replace eucomp=1 if Companycountry=="LU"
replace eucomp=1 if Companycountry=="MT"
replace eucomp=1 if Companycountry=="NL"
replace eucomp=1 if Companycountry=="NO"
replace eucomp=1 if Companycountry=="PL"
replace eucomp=1 if Companycountry=="PT"
replace eucomp=1 if Companycountry=="RO"
replace eucomp=1 if Companycountry=="SE"
replace eucomp=1 if Companycountry=="SI"


/* COMPANY COUNTRIES
AT Austria
BE Belgium
CH Switzerland
CY Cyprus
CZ Czech Republic
DE Germany
DK Denmark
ES Spain
FI Finland
FR France
GB United Kingdom
HU Hungary
IE Ireland
IT Italy
LI Liechtenstein
LU Luxembourg
MT Malta
NL Netherlands
NO Norway
PL Poland
PT Portugal
RO Romania
SE Sweden
SI Slovenia
*/

tabulate Subsidiarycountry

/*
AD Andorra
AL Albania
AT Austria
BE Belgium
BG Bulgaria
BY Belarus
CH Switzerland
CY Cyprus
CZ Czech Republic
DE Germany
DK Denmark
EE Estonia
ES Spain
FI Finland
FR France
GB United Kingdom
GI Gibraltar
GR Greece
HU Hungary
IE Ireland
IS Iceland
IT Italy
LI Liechtenstein
LT Lithuania
LU Luxembourg
MC Monaco
MD Moldova
ME Montenegro
MK North Macedonia
MT Malta
NL Netherlands
NO Norway
PL Poland
PT Portugal
RO Romania
RS Serbia
SE Sweden
SI Slovenia
SK Slovakia
SM San Marino
TR Turkey
UA Ukraine
*/

generate eusub=0
replace eusub=1 if Subsidiarycountry=="AD"
replace eusub=1 if Subsidiarycountry=="AL"
replace eusub=1 if Subsidiarycountry=="AT"
replace eusub=1 if Subsidiarycountry=="BE"
replace eusub=1 if Subsidiarycountry=="BG"
replace eusub=1 if Subsidiarycountry=="BY"
replace eusub=1 if Subsidiarycountry=="CH"
replace eusub=1 if Subsidiarycountry=="CY"
replace eusub=1 if Subsidiarycountry=="CZ"
replace eusub=1 if Subsidiarycountry=="DE"
replace eusub=1 if Subsidiarycountry=="DK"
replace eusub=1 if Subsidiarycountry=="EE"
replace eusub=1 if Subsidiarycountry=="ES"
replace eusub=1 if Subsidiarycountry=="FI"
replace eusub=1 if Subsidiarycountry=="FR"
replace eusub=1 if Subsidiarycountry=="GB"
replace eusub=1 if Subsidiarycountry=="GI"
replace eusub=1 if Subsidiarycountry=="GR"
replace eusub=1 if Subsidiarycountry=="HU"
replace eusub=1 if Subsidiarycountry=="IE"
replace eusub=1 if Subsidiarycountry=="IS"
replace eusub=1 if Subsidiarycountry=="IT"
replace eusub=1 if Subsidiarycountry=="LI"
replace eusub=1 if Subsidiarycountry=="LT"
replace eusub=1 if Subsidiarycountry=="LU"
replace eusub=1 if Subsidiarycountry=="MC"
replace eusub=1 if Subsidiarycountry=="MD"
replace eusub=1 if Subsidiarycountry=="ME"
replace eusub=1 if Subsidiarycountry=="MK"
replace eusub=1 if Subsidiarycountry=="MT"
replace eusub=1 if Subsidiarycountry=="NL"
replace eusub=1 if Subsidiarycountry=="NO"
replace eusub=1 if Subsidiarycountry=="PL"
replace eusub=1 if Subsidiarycountry=="PT"
replace eusub=1 if Subsidiarycountry=="RO"
replace eusub=1 if Subsidiarycountry=="RS"
replace eusub=1 if Subsidiarycountry=="SE"
replace eusub=1 if Subsidiarycountry=="SI"
replace eusub=1 if Subsidiarycountry=="SK"
replace eusub=1 if Subsidiarycountry=="SM"
replace eusub=1 if Subsidiarycountry=="TR"
replace eusub=1 if Subsidiarycountry=="UA"

browse Company Companycountry Subsidiarycountry Year sumsubaffs summinstakes eucomp eusub

***** 
* Descriptives EU companies
*****

browse Company sumsubaffs summinstakes if eucomp==1 & Year==2021 & Subsidiarycountry=="US"

ssc install distinct

help distinct

distinct ISIN if eucomp==1 & Year==2021
distinct ISIN if Companycountry=="AT" & Year==2021
distinct ISIN if Companycountry=="BE" & Year==2021
distinct ISIN if Companycountry=="CH" & Year==2021
distinct ISIN if Companycountry=="CY" & Year==2021
distinct ISIN if Companycountry=="CZ" & Year==2021
distinct ISIN if Companycountry=="DE" & Year==2021
distinct ISIN if Companycountry=="DK" & Year==2021
distinct ISIN if Companycountry=="ES" & Year==2021
distinct ISIN if Companycountry=="FI" & Year==2021
distinct ISIN if Companycountry=="FR" & Year==2021
distinct ISIN if Companycountry=="GB" & Year==2021
distinct ISIN if Companycountry=="HU" & Year==2021
distinct ISIN if Companycountry=="IE" & Year==2021
distinct ISIN if Companycountry=="IT" & Year==2021
distinct ISIN if Companycountry=="LI" & Year==2021
distinct ISIN if Companycountry=="LU" & Year==2021
distinct ISIN if Companycountry=="MT" & Year==2021
distinct ISIN if Companycountry=="NL" & Year==2021
distinct ISIN if Companycountry=="NO" & Year==2021
distinct ISIN if Companycountry=="PO" & Year==2021
distinct ISIN if Companycountry=="PT" & Year==2021
distinct ISIN if Companycountry=="RO" & Year==2021
distinct ISIN if Companycountry=="SE" & Year==2021
distinct ISIN if Companycountry=="SI" & Year==2021

sort Companycountry Year
by Companycountry Year: egen countrysumsubaffs=sum(subaffs)
by Companycountry Year: egen countryminstakes=sum(minoritystakes)

*
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="AT" & Year==2021
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="BE" & Year==2021
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="CH" & Year==2021
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="CY" & Year==2021
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="CZ" & Year==2021
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="DE" & Year==2021
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="DK" & Year==2021
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="ES" & Year==2021
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="FI" & Year==2021
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="FR" & Year==2021
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="GB" & Year==2021
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="HU" & Year==2021
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="IE" & Year==2021
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="IT" & Year==2021
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="LI" & Year==2021
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="LU" & Year==2021
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="MT" & Year==2021
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="NL" & Year==2021
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="NO" & Year==2021
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="PO" & Year==2021
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="PT" & Year==2021
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="RO" & Year==2021
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="SE" & Year==2021
browse Companycountry Company Year countrysumsubaffs countryminstakes if Companycountry=="SI" & Year==2021

*******
* Descriptives intra-EU
*******

*SUBS&AFFS
generate eusubs=0
replace eusubs=subaffs if eusub==1

sort ISIN Year

by ISIN Year: egen euregionsubs=sum(eusubs+0)

browse Companycountry Company Subsidiarycountry sumsubaffs euregionsubs ussubs chinahksubs if eucomp==1 & Year==2021

generate euregionsubs_rel=(euregionsubs/sumsubaffs)

browse Companycountry Company Subsidiarycountry sumsubaffs euregionsubs euregion_rel ussubs ussubs_rel chinahksubs chinahksubs_rel if eucomp==1 & Year==2021

sum euregion_rel if eucomp==1 & Year==2021, detail
*more than 60% of subs held in Europe
sum euregion_rel if eucomp==1 & Year==2015, detail
*similar in 2015



*MINS
generate eumins=0
replace eumins=minoritystakes if eusub==1

sort ISIN Year

by ISIN Year: egen euregionsmins=sum(eumins+0)

generate euregionmins_rel=(euregionsmins/summinstakes)

browse Companycountry Company Subsidiarycountry summinstakes euregionsmins euregionmins_rel chinahkmins chinahkmins_rel if Year==2021 & eucomp==1

sum euregionmins_rel if eucomp==1 & Year==2021, detail
* lower, median 45% & mean 48% 

*for comparison to US
generate usmins=0
replace usmins=minoritystakes if Subsidiarycountry=="US"

sort ISIN Year

by ISIN Year: egen usminsum=sum(usmins+0)

generate usmins_rel=(usminsum/summinstakes)

sum usmins_rel if eucomp==1 & Year==2021, detail

*****
* share non-EU
****

* subs&affs

generate sumsubaffs_noneu=(sumsubaffs-euregionsubs)

generate chinahksubs_relnoneu=(chinahksubs/sumsubaffs_noneu)

browse Companycountry Company Subsidiarycountry sumsubaffs euregionsubs sumsubaffs_noneu chinahksubs chinahksubs_rel chinahksubs_relnoneu if eucomp==1 & Year==2021

sum chinahksubs_rel if eucomp==1 & Year==2021, detail

sum ussubs_rel if eucomp==1 & Year==2021, detail

sum chinahksubs_relnoneu if eucomp==1 & Year==2021, detail

* minstakes

generate summinstakes_noneu=(summinstakes-euregionsmins)

generate chinahkmins_relnoneu=(chinahkmins/summinstakes_noneu)

sum chinahkmins_rel if eucomp==1 & Year==2021, detail

sum chinahkmins_relnoneu if eucomp==1 & Year==2021, detail

********
*FIGURE 5: Kernel density distribution
********

set scheme plotplain

twoway (kdensity chinahksubs_relnoneu if eucomp==1 & Year==2021) 

twoway (kdensity chinahksubs_relnoneu if eucomp==1 & Year==2021) (kdensity chinahksubs_relnoneu if eucomp==1 & Year==2021 & Companycountry=="GB") (kdensity chinahksubs_relnoneu if eucomp==1 & Year==2021 & Companycountry=="DE") (kdensity chinahksubs_relnoneu if eucomp==1 & Year==2021 & Companycountry=="FR") (kdensity chinahksubs_relnoneu if eucomp==1 & Year==2021 & Companycountry=="SE") (kdensity chinahksubs_relnoneu if eucomp==1 & Year==2021 & Companycountry=="CH") 


* Table 1: Firm-level average ratios
sum chinahksubs_relnoneu if Companycountry=="AT" & Subsidiarycountry=="AT" & Year==2021, detail
sum chinahksubs_relnoneu if Companycountry=="BE" & Subsidiarycountry=="BE" & Year==2021, detail
sum chinahksubs_relnoneu if Companycountry=="CH"& Subsidiarycountry=="CH" & Year==2021, detail
sum chinahksubs_relnoneu if Companycountry=="DE"& Subsidiarycountry=="DE" & Year==2021, detail
sum chinahksubs_relnoneu if Companycountry=="DK"& Subsidiarycountry=="DK" & Year==2021, detail
sum chinahksubs_relnoneu if Companycountry=="ES"& Subsidiarycountry=="ES" & Year==2021, detail
sum chinahksubs_relnoneu if Companycountry=="FI"& Subsidiarycountry=="FI" & Year==2021, detail
sum chinahksubs_relnoneu if Companycountry=="FR"& Subsidiarycountry=="FR" & Year==2021, detail
sum chinahksubs_relnoneu if Companycountry=="GB"& Subsidiarycountry=="GB" & Year==2021, detail
sum chinahksubs_relnoneu if Companycountry=="IE"& Subsidiarycountry=="IE" & Year==2021, detail
sum chinahksubs_relnoneu if Companycountry=="IT"& Subsidiarycountry=="IT" & Year==2021, detail
sum chinahksubs_relnoneu if Companycountry=="LU"& Subsidiarycountry=="LU" & Year==2021, detail
sum chinahksubs_relnoneu if Companycountry=="NL"& Subsidiarycountry=="NL" & Year==2021, detail
sum chinahksubs_relnoneu if Companycountry=="NO"& Subsidiarycountry=="NO" & Year==2021, detail
sum chinahksubs_relnoneu if Companycountry=="PT"& Subsidiarycountry=="PT" & Year==2021, detail
sum chinahksubs_relnoneu if Companycountry=="SE"& Subsidiarycountry=="SE" & Year==2021, detail

***
sort chinahksubs_relnoneu

sum sumsubaffs if eucomp==1, detail
*50th 167
*75th 493

browse Company Companycountry Year sumsubaffs chinahksubs sumsubaffs_noneu chinahksubs_relnoneu if sumsubaffs>492 & eucomp==1 & Year==2021

********
* TABLE 2: Degree of concentration EU firms
********

sort ISIN Year

browse Company Companycountry Year sumsubaffs unknownsubs_rel chinahksubs sumsubaffs_noneu chinahksubs_relnoneu if sumsubaffs>46 & eucomp==1 & Subsidiarycountry=="CN" & chinahksubs>9


*************************
* CHINESE COMPANIES
*************************

distinct ISIN if Companycountry=="CN" & Year==2021
distinct ISIN if Companycountry=="HK" & Year==2021
distinct ISIN if Companycountry=="MO" & Year==2021


*to see list
*subs
browse Companycountry Company Year subaffs countrysumsubaffs if Companycountry=="CN" & Subsidiarycountry=="CN" & Year==2021

browse Companycountry Company Year subaffs countrysumsubaffs if Companycountry=="HK" & Subsidiarycountry=="HK" & Year==2021
*mins
browse Companycountry Company Year minoritystakes countryminstakes if Companycountry=="CN" & Subsidiarycountry=="CN" & Year==2021

browse Companycountry Company Year minoritystakes countryminstakes if Companycountry=="HK" & Subsidiarycountry=="HK" & Year==2021

*
generate subsnoncnhk=(sumsubaffs-chinahksubs)

browse Companycountry Company Year Subsidiarycountry subaffs sumsubaffs euregionsubs subsnoncnhk if Companycountry=="CN" & Year==2021

*
generate sharedomsubscnhk=(chinahksubs/sumsubaffs)
sum sharedomsubscnhk if Companycountry=="CN" & Year==2021, detail
sum sharedomsubscnhk if Companycountry=="HK" & Year==2021, detail

*
generate euregionsubs_relnoncnhk=(euregionsubs/subsnoncnhk)

sum euregionsubs_relnoncnhk if Companycountry=="CN" & Year==2021, detail
sum euregionsubs_relnoncnhk if Companycountry=="HK" & Year==2021, detail

********
*FIGURE 7: Kernel density of Chinese companies
********
twoway (kdensity euregionsubs_relnoncnhk if Companycountry=="CN" & Year==2021) (kdensity euregionsubs_relnoncnhk if Companycountry=="HK" & Year==2021)

* List firms
generate chinahkdummy_comp=0
replace chinahkdummy_comp=1 if Companycountry=="CN"
replace chinahkdummy_comp=1 if Companycountry=="HK"

sort sumsubaffs

browse Company Companycountry Year sumsubaffs euregionsubs if Year==2021 & chinahkdummy_comp==1
*
sort euregionsubs

browse Company Companycountry Year sumsubaffs euregionsubs if Year==2021 & chinahkdummy_comp==1
*
sort euregionsubs_relnoncnhk 

sum sumsubaffs if Companycountry=="CN", detail
*50th 34
*75th 296

********
*TABLE 3: Degree of concnetration Chinese firms
********
browse Company Companycountry Year sumsubaffs euregionsubs subsnoncnhk euregionsubs_relnoncnhk if sumsubaffs>295 & Year==2021 & chinahkdummy_comp==1